import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// // https://vitejs.dev/config/
// export default defineConfig({
//   plugins: [vue()],
// })
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
    server: {
        host: true,
        proxy: {
            '/api': {
                target: 'http://43.138.15.137:3000', //实际请求地址
                changeOrigin: true, // 是否改变请求源
                rewrite: (path) => path.replace(/^\/api/, '') // 路径重写
            },
        }
    },
    plugins: [
        vue(),
        eslintPlugin({
            // fix: true, //修复f错误
            include: [
                'src/**/*.vue',
                'src/**/*.ts',
                'src/**/*.js'
            ],
        }),
    ]
})
